<?php

namespace app\common\model;

use think\Model;

/**
 * 答题记录
 */
class YalimediaQuestionLog extends Model
{
    protected $table = 'fa_yalimedia_question_log';

    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';


    public function detail()
    {
        return $this->belongsTo('YalimediaQuestionLogDetail', 'log_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function getAllQuestionIdsAttr($value)
    {
       
        if (empty($value)) {
            return [];
        }
        return explode(',',$value);
    }

    public function getEmptyIdsAttr($value)
    {
       
        if (empty($value)) {
            return [];
        }
        return explode(',',$value);
    }

    public function getRightIdsAttr($value)
    {
       
        if (empty($value)) {
            return [];
        }
        return explode(',',$value);
    }

    public function getErrorIdsAttr($value)
    {
       
        if (empty($value)) {
            return [];
        }
        return explode(',',$value);
    }

}
